package com.huashi.dealer.modular.business.order.enums;

import com.huashi.dealer.enums.EnumBasics;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum TimeType implements EnumBasics {

    MONTH(10, "当月"),
    QUARTER(20, "季度"),
    YEAR(30, "年度");

    private final Integer value;
    private final String name;
    /**
     * 获取枚举数据
     * @return 枚举数组
     */
    @Override
    public EnumBasics[] data() {
        return values();
    }

    /**
     * 根据值获取枚举
     * @param value 枚举值
     * @return 枚举对象
     */
    public static TimeType getByValue(Integer value) {
        return (TimeType) EnumBasics.getByValue(values(), value);
    }
}
